package com.ibeeking.found.content.api.feign;

import com.ibeeking.found.content.api.feign.fallback.FileBFallbackFactory;
import com.ibeeking.nematos.utils.result.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @Author ibeeking
 */
@FeignClient(name = "base-file-b-server", path = "/b", contextId = "contentFileBClient", fallbackFactory = FileBFallbackFactory.class, decode404 = true)
public interface FileBClient {


    /**
     * 文件上传
     *
     * @throws IOException
     */
    @RequestMapping(method = RequestMethod.POST, value = "/file/feign/v1/upload",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    ResponseResult<String> uploadFile(@RequestPart("file") MultipartFile file) throws IOException ;

}
